import React from 'react'
import { setloading } from '../../store/actions/app';
import { useSelector,useDispatch } from 'react-redux';

const index = ()=>{
    const {loading}= useSelector(state=>state.app)
    const dispatch=useDispatch()
    return (
        <div>
            {
                loading ? 'loading' : '已加载'
            }
            <button onClick={()=>{dispatch(setloading())}}>切换</button>
        </div>
    )
}

export default index